<template>
  <div>
    <div class="playlist-info">
      <div class="cover">
        <div class="cover-container">
          <button class="play-button">
            <span class="svg-icon">
              <span class="iconfont icon-bofang" />
            </span>
          </button>
          <img :src="playlist.coverImgUrl" style="width:288px;height:288px">
        </div>
      </div>
      <div class="info">
        <div class="title">{{ playlist.name }}</div>
        <div class="artist">Playlist by <a :href="`https://music.163.com/#/user/home?id=${playlist.creator.userId}`" target="blank">{{ playlist.creator.nickname }}</a></div>
        <div class="date-and-count">最后更新于 2022年01月21日 · 112 首歌</div>
        <div class="description" @click="showDialog=true">{{ playlist.description }}</div>
        <div class="buttons">
          <button class="bule" style="border-radius: 8px; padding: 8px 16px;">
            <span class="iconfont icon-bofang" />
            播放</button>
          <button class="grey">
            <span class="svg-icon">
              <span class="iconfont icon-aixin" />
            </span>
          </button>
          <button class="grey">
            <span class="svg-icon" style="margin-right:0px">
              <span class="iconfont icon-gengduo" />
            </span>
          </button>
        </div>
      </div>
    </div>
    <div>
      <el-dialog :visible.sync="showDialog" title="歌单介绍">
        <div class="description">{{ playlist.description }}</div>
      </el-dialog>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    playlist: {
      type: Object,
      required: true
    }

  },
  data() {
    return {
      showDialog: false
    }
  }
}
</script>

<style lang="less" scoped>
.playlist-info{
  display: flex;
  margin-bottom:72px ;
  position: relative;
  .cover{
    position: relative;
    transition:transform .3s;
    .cover-container{
      position: relative;
      &:hover .play-button{
        display: block;
      }
      // .shade{
      //   display: flex;
      //   justify-content: center;
      //   align-content: center;
      //   position: absolute;
      //   top:0;
      //   height: 100%;
      //   width: 100%;
      //   background: transparent;
        .play-button{
          position: absolute;
          top: 50%;
          left: 50%;
          transform: translate(-50%,-50%);
          color: #ffffff;
          height: 50px;
          width: 50px;
          backdrop-filter: blur(8px);
          background: hsla(0,0%,100%,.14);
          border: 1px solid hsla(0,0%,100%,.08);
          border-radius: 50%;
          cursor: default;
          transition: .2s;
          display: none;
          .svg-icon{
            // height: 44%;
            display: flex;
            justify-content: center;
            align-items: center;
          .icon-bofang{
            font-size: 25px;
          }
          }
        }
      // }
      img{
        border-radius: 0.75em;
        user-select: none;
        aspect-ratio: 1/1;
        border: 1px solid rgba(0,0,0,.04);
      }
      .shadow{
        position: absolute;
        top: 12px;
        height: 100%;
        width: 100%;
        filter: blur(16px) opacity(.6);
        transform: scale(.92,.96);
        z-index: -1;
        background-size: cover;
        border-radius: 0.75em;
        aspect-ratio: 1/1;
      }
    }
  }
  .info{
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex:1;
    margin-left: 56px;
    .title{
      width: 100%;
      font-size: 36px;
      font-weight: 700;
      color:rgb(0, 0, 0);
      .lock-icon {
        opacity: 0.28;
        color: var(--color-text);
        margin-right: 8px;
        .svg-icon {
          height: 26px;
          width: 26px;
        }
      }
    }
    .artist{
      font-size: 18px;
      opacity: .88;
      color: rgb(0, 0, 0);
      margin-top: 24px;
      a{
          text-decoration: none;
          color:rgb(0, 0, 0);
            &:hover{
            text-decoration: underline;
            }
      }
    }
    .date-and-count{
      font-size: 14px;
      opacity: .68;
      color: rgb(0, 0, 0);
      margin-top: 2px;
    }
    .description{
      font-size: 14px;
      opacity: 0.68;
      color: var(--color-text);
      margin-top: 24px;
    //   display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 3;
      overflow: hidden;
      cursor: pointer;
    }
    .buttons {
      margin-top: 32px;
      display: flex;
      .bule{
        color: #335eea;
        font-size: 18px;
        line-height: 18px;
        font-weight: 600;
        height: 40px;
       width: 92px;
      }
      button {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 16px;
        border: none;
      //  color: #335eea;
       font-weight: bold;
       padding: 8px 16px;
      }
       .bule{
         background-color: rgb(234, 239, 253);
         transition: .2s;
         &:hover{
           transform:scale(1.1, 1.1);
         }
       }
       .grey{
         background-color: #ffffff;
           width: 40px;
           border-radius:8px;
           transition: .2s;
           &:hover{
           transform:scale(1.1, 1.1);
           }
       }
    }
  }
}
</style>
